package cliente;

import gui.LoginPanel;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import javax.swing.JFrame;
import servidor.IdentificadorPerfilServidorInterface;

public class IdentificadorPerfilCliente {

    private IdentificadorPerfilCliente() {}

    public static void main(String[] args) {

        

        String host = (args.length < 1) ? null : args[0];
        IdentificadorPerfilServidorInterface stub = null;
        try
        {
            Registry registry = LocateRegistry.getRegistry(host);
            stub = (IdentificadorPerfilServidorInterface) registry.lookup("IdentificadorPerfilServidor");
        }
        catch (Exception e)
        {
            System.err.println("Client exception: " + e.toString());
            e.printStackTrace();
        }

        LoginPanel loginPanel = new LoginPanel();
        loginPanel.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        loginPanel.setServidor(stub);
        loginPanel.setVisible(true);
    }
}
